/*
 * @Author: huyu
 * @Date: 2020-06-16 12:06:32
 * @Last Modified by: huyu
 * @Last Modified time: 2020-06-16 12:54:05
 */

// 回到顶部组件

import React from "react"
import style from "./index.module.less"

function scrollTo() {
  window.scrollTo({ top: 0, behavior: "smooth" })
}

function ToTop() {
  return (
    <button title="回到顶部" className={style.top} onClick={scrollTo}>
      top
    </button>
  )
}

export default ToTop
